%ifndef __ZHU_OS_KERNEL64_COMMON_INC__
%define __ZHU_OS_KERNEL64_COMMON_INC__
; SPIN_LOCK al, byte [lock_state]
%macro SPIN_LOCK 2
    .spinlock:
        mov %1, 1
        jmp .spin
    .pause:
        pause
    .spin:
        xchg %1, %2
        test %1, %1
        jnz .pause
%endmacro

; SPIN_UNLOCK byte [lock_state]
%macro SPIN_UNLOCK 1
    mov %1, 0
%endmacro
%endif